﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeCylinder : OdGeSurface
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeCylinder(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeCylinder_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeCylinder obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeCylinder()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeCylinder(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeCylinder() : this(GlobalsPINVOKE.new_OdGeCylinder__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCylinder(double radius, OdGePoint3d origin, OdGeVector3d axisOfSymmetry) : this(GlobalsPINVOKE.new_OdGeCylinder__SWIG_1(radius, OdGePoint3d.getCPtr(origin), OdGeVector3d.getCPtr(axisOfSymmetry)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCylinder(double radius, OdGePoint3d origin, OdGeVector3d axisOfSymmetry, OdGeVector3d refAxis, OdGeInterval height, double startAng, double endAng) : this(GlobalsPINVOKE.new_OdGeCylinder__SWIG_2(radius, OdGePoint3d.getCPtr(origin), OdGeVector3d.getCPtr(axisOfSymmetry), OdGeVector3d.getCPtr(refAxis), OdGeInterval.getCPtr(height), startAng, endAng), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCylinder(OdGeCylinder arg0) : this(GlobalsPINVOKE.new_OdGeCylinder__SWIG_3(OdGeCylinder.getCPtr(arg0)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double radius()
		{
			double result = GlobalsPINVOKE.OdGeCylinder_radius(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d origin()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeCylinder_origin(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getAngles(out double startAng, out double endAng)
		{
			GlobalsPINVOKE.OdGeCylinder_getAngles(this.swigCPtr, out startAng, out endAng);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getHeight(OdGeInterval height)
		{
			GlobalsPINVOKE.OdGeCylinder_getHeight(this.swigCPtr, OdGeInterval.getCPtr(height));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double heightAt(double u)
		{
			double result = GlobalsPINVOKE.OdGeCylinder_heightAt(this.swigCPtr, u);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector3d axisOfSymmetry()
		{
			OdGeVector3d result = new OdGeVector3d(GlobalsPINVOKE.OdGeCylinder_axisOfSymmetry(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector3d refAxis()
		{
			OdGeVector3d result = new OdGeVector3d(GlobalsPINVOKE.OdGeCylinder_refAxis(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isOuterNormal()
		{
			bool result = GlobalsPINVOKE.OdGeCylinder_isOuterNormal(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isClosed(OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeCylinder_isClosed__SWIG_0(this.swigCPtr, OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isClosed()
		{
			bool result = GlobalsPINVOKE.OdGeCylinder_isClosed__SWIG_1(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCylinder setRadius(double radius)
		{
			OdGeCylinder result = new OdGeCylinder(GlobalsPINVOKE.OdGeCylinder_setRadius(this.swigCPtr, radius), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCylinder setAngles(double startAng, double endAng)
		{
			OdGeCylinder result = new OdGeCylinder(GlobalsPINVOKE.OdGeCylinder_setAngles(this.swigCPtr, startAng, endAng), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCylinder setHeight(OdGeInterval height)
		{
			OdGeCylinder result = new OdGeCylinder(GlobalsPINVOKE.OdGeCylinder_setHeight(this.swigCPtr, OdGeInterval.getCPtr(height)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCylinder set(double radius, OdGePoint3d origin, OdGeVector3d axisOfSym)
		{
			OdGeCylinder result = new OdGeCylinder(GlobalsPINVOKE.OdGeCylinder_set__SWIG_0(this.swigCPtr, radius, OdGePoint3d.getCPtr(origin), OdGeVector3d.getCPtr(axisOfSym)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCylinder set(double radius, OdGePoint3d origin, OdGeVector3d axisOfSymmetry, OdGeVector3d refAxis, OdGeInterval height, double startAng, double endAng)
		{
			OdGeCylinder result = new OdGeCylinder(GlobalsPINVOKE.OdGeCylinder_set__SWIG_1(this.swigCPtr, radius, OdGePoint3d.getCPtr(origin), OdGeVector3d.getCPtr(axisOfSymmetry), OdGeVector3d.getCPtr(refAxis), OdGeInterval.getCPtr(height), startAng, endAng), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGeLinearEnt3d linEnt, out int numInt, OdGePoint3d p1, OdGePoint3d p2, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeCylinder_intersectWith__SWIG_0(this.swigCPtr, OdGeLinearEnt3d.getCPtr(linEnt), out numInt, OdGePoint3d.getCPtr(p1), OdGePoint3d.getCPtr(p2), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGeLinearEnt3d linEnt, out int numInt, OdGePoint3d p1, OdGePoint3d p2)
		{
			bool result = GlobalsPINVOKE.OdGeCylinder_intersectWith__SWIG_1(this.swigCPtr, OdGeLinearEnt3d.getCPtr(linEnt), out numInt, OdGePoint3d.getCPtr(p1), OdGePoint3d.getCPtr(p2));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCylinder Assign(OdGeCylinder cylinder)
		{
			OdGeCylinder result = new OdGeCylinder(GlobalsPINVOKE.OdGeCylinder_Assign(this.swigCPtr, OdGeCylinder.getCPtr(cylinder)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setIsOuterNormal(bool isOuterNormal)
		{
			GlobalsPINVOKE.OdGeCylinder_setIsOuterNormal(this.swigCPtr, isOuterNormal);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
